package com.xkcoding.orm.mybatis.plus.schedule;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.io.FileNotFoundException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

@Slf4j
@Component
@EnableScheduling
public class Jobs {


    //表示每天1时0分0秒执行   debugLog
    @Scheduled(cron = "0 0 1 * * ?")
    public void debugLog() {
        log.debug("开始定时任务:"+ new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));

        log.debug("结束定时任务:"+ new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
    }

}
